import { computed, CSSProperties } from "vue";
import { PickerProps } from "./pickerProps";

export function usePanelStyles(props: PickerProps) {
    const panelStyles = computed<CSSProperties>(()=>{
        const zIndex = props.panelBaseZIndex
        let left:string|undefined = undefined
        let right:string|undefined = undefined
        const pos = props.pos
        if(typeof pos === 'number'){
            left = pos + 'px'
        }else{
            if(pos=='left')
                right = '0px'
            else
                left = '0px'
        }
        return{
            zIndex:(zIndex||0)+100,
            left,
            right
        }
    })
    return {
        panelStyles
    }
}